package come.bjpowernode.javase.io;

import java.io.BufferedReader;
import java.io.FileInputStream;
import java.io.InputStream;
import java.io.InputStreamReader;

/*
转换流：
    InputStreamReader。
 */
public class BufferedReaderTest02 {
    public static void main(String[] args)throws Exception {
        /*//字节流
        FileInputStream in = new FileInputStream("readerFile");
        //通过转换流转换(InputStreamReader将字节流转换为字符流)
        //in是节点流，reader是包装流
        InputStreamReader reader = new InputStreamReader(in);
        //这个构造方法只能转字符流
        //reader是节点流，br是包装流
        BufferedReader br = new BufferedReader(reader);*/

        //合并
        BufferedReader br = new BufferedReader(new InputStreamReader(new FileInputStream("readerFile")));
        String line = null;
        while((line = br.readLine())!= null){
            System.out.println(line);
        }

        //关闭
        br.close();
    }
}
